<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CodeNote extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('code_note', function (Blueprint $table) {
            $table->increments('code_note_id');

            $table->string('type')->comment('类型')->nullable()->default(0);
            $table->string('js')->comment('js')->nullable()->default('');
            $table->string('wxss')->comment('wxss')->nullable()->default('');
            $table->string('wxml')->comment('wxml')->nullable()->default('');

            $table->integer('user_id')->comment('用户id')->default(1);
            $table->timestamp('created_at')->nullable()->comment('创建时间');
            $table->timestamp('updated_at')->nullable()->comment('更新时间');
            $table->softDeletes();
            $table->string('memo')->nullable()->comment('备注');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('code_note');
    }
}
